<template>
	<view class="container">
		<view class="list border-b" v-for="item in List">
			<view class="realname">
				<view class="title">推荐奖励</view>
				<view class="user">用户ID：{{item.UserID}}</view>
			</view>
			<view class="statedate">
				<view class="state">+{{item.Money.toFixed(2)}}</view>
				<view class="date">{{Tools.toDate(item.CreateDate)}}</view>
			</view>
		</view>
		<view class="nodata" v-if="NoData"></view>
		<view class="loadmore">{{Tip}}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Tip:'正在加载...',
				Page:1,
				List:[],
				NoData:false,
				LoadMore:true,
				Keyword:'',
			};
		},
		onPullDownRefresh() {
			this.Re_Load();
		},
		onReachBottom() {
			if(this.LoadMore){
				this.Page++;
				this.Find_Pager();
			}
		},
		onLoad() {
			this.Find_Pager();
		},
		methods:{
			Find_Pager(){
				var data={};
				data.Act="Find_RewardRecord";
				data.Page=this.Page;
				data.Keyword=this.Keyword;
				data.Grade=this.Grade;
				data.Limit=20;
				this.Util.Loading("加载中...");
				this.Util.Post(data, json=>{
					this.Util.HideLoading();
					uni.stopPullDownRefresh();
					this.List= this.List.concat(json.Data.List);
					if(this.Grade==-1 && this.Page==1){
						this.Count=json.Data.Count;
						this.CommonCount=json.Data.CommonCount;
						this.VipCount=json.Data.VipCount;
					}
					
					if(json.Data.Count==0){
						this.NoData=true;
						this.Tip="还没有任何成员";
					}
					else if(this.List.length>=json.Data.Count){
						this.LoadMore=false;
						this.Tip="我是有底线的";
					}
				});
			},
			Re_Load(){
				this.List=[];
				this.Page=1;
				this.NoData=false;
				this.LoadMore=true;
				this.Tip='正在加载...';
				this.Find_Pager();
			}
		}
	}
</script>

<style lang="scss">
	.tab{width:100%; height:100rpx; display: flex; flex-direction: row; justify-content: space-between; position: fixed; padding-left: 30rpx; padding-right: 30rpx; top:0rpx; left:0rpx; background-color: #ffffff;
		.line{width:auto; height:100rpx; line-height: 100rpx; }
		.select{border-bottom:4rpx solid #cf1a02; color:#cf1a02;}
	}
	.list{width:100%; height:140rpx; padding:20rpx; margin-bottom:15rpx; display: flex; flex-direction: row; background-color: #ffffff;
		.headimg{width:100rpx; height:100rpx; border-radius:16rpx; image{width:100%; height:100%;}}
		.realname{flex:1; height: 100rpx; padding-left:20rpx; text-align:left;
			.title{width:100%; height:50rpx; line-height: 50rpx;}
			.user{width:100%; height:50rpx; line-height: 50rpx; font-size:32rpx; color:#a8a8a8;}
		}
		.statedate{width:160rpx; height:100%;
			.state{width:140rpx; height:50rpx; line-height: 50rpx; font-size:30rpx; font-weight:bold; text-align: right; font-size:34rpx; border-radius:30rpx; color:green;}
			.normal{background-color: #a8a8a8 !important;}
			.date{width:100%; font-size:30rpx; padding-top:10rpx; color:#a8a8a8;}
		}
	}
</style>
